import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    id: qnm_about

    tools: ToolBarLayout {
        id: tool_only_back
        ToolIcon {
            id: toolIconBack
            //iconId: "toolbar-back"
            iconSource: "images/toolbar/back.png"
            onClicked: {
                pageStack.pop();
            }
        }
        opacity: userTheme.opacityToolbar
    }

    property string version: "0.8.0"

    onVisibleChanged: {
        if( visible ) {
            animImage.running = true
        }
    }

    ParallelAnimation {
        id: animImage
        running: false
        NumberAnimation { target: imgAbout; property: "scale"; from: 10; to: 1; duration: 600 }
        NumberAnimation { target: imgAbout; property: "opacity"; from: 0; to: 1; duration: 1200 }
    }

    BackgroundPage { }

    Item {
        id: mainPane
        //anchors.centerIn: parent
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top: parent.top
        anchors.bottom: parent.bottom
        anchors.leftMargin: 12
        anchors.rightMargin: 12
        anchors.topMargin: 12
        anchors.bottomMargin: 12

        Item {
            id: img_about

            anchors.top: parent.top
            anchors.left: parent.feft
            width: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.width/2 : parent.width
            height: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.height : parent.height/2

            Image {
                id: imgAbout
                //source: "images/categories.png"
                source: "images/categories-blue.png"

                width: 160
                height: 160

                //anchors.centerIn: parent
                anchors.horizontalCenter: parent.horizontalCenter
                anchors.top: parent.top
                anchors.topMargin: 60
                smooth: true
                fillMode: Image.PreserveAspectFit
            }

            Label {
                id: lblQnetMan
                anchors.top: imgAbout.bottom
                anchors.topMargin: 30
                anchors.horizontalCenter: parent.horizontalCenter
                text: "MeeWords";
                font.pixelSize: 40
                font.bold: true
                color: "blue"
            }
        }

        //------------------

        Item {
            id: textAbout
            width: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.width/2 : parent.width
            height: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.height : parent.height/2

            anchors.top: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.top : img_about.bottom
            anchors.bottom: parent.bottom
            anchors.left: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? img_about.right : parent.left

            anchors.topMargin: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? 0 : -50
            //anchors.bottomMargin: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? 0 : -50

            anchors.leftMargin: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? -10 : 10
            anchors.rightMargin:  screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? -20 : 10


            Flickable {
                id: flickAboutText
                //anchors.top: lblQnetMan.bottom
                anchors.top: parent.top
                anchors.topMargin: 5
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 5
                contentHeight: colAboutText.height
                contentWidth: colAboutText.width
                flickableDirection: Flickable.VerticalFlick
                height: textAbout.height
                width: textAbout.width
                clip: true

                Column {
                    id: colAboutText
                    spacing: 20
                    Label { text: "<b>" + qsTr("Version") +":</b> "+ version }
                    Label { text: "<b>" + qsTr("Author") + ":</b> " + qsTr("Anatoly Kozlov") }
                    Label { text: "<b>" + qsTr("Thanks:")+"</b>" }
                    Label { text: "<ul><li>"+qsTr("Vladimir Sinichkin - for translation")+"</li></ul>" }
                    Label { text: "<b>" + qsTr("Licence:")+"</b>" }
                    Label { text: qsTr("GPL v3") }
                    Label { text: "<a href='http://www.gnu.org/licenses/gpl.html'>http://www.gnu.org/licenses/gpl.html</a>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    Label { text: qsTr("This application is open source.\nSource code and other details \non the web-page of the project:")}
                    Label { /*anchors.horizontalCenter: parent.horizontalCenter;*/ font.pixelSize: 19; text: "<br/><a href='https://projects.developer.nokia.com/meewords'>http://projects.developer.nokia.com/meewords</a><br/>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    Label { text: "\n"}
                }

            } //Flickable

            ScrollDecorator {
                flickableItem: flickAboutText
            }
        } //Column
    } //Item

}
